/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.ps.server.classes;

/**
 *
 * @author Ricardo
 */
public class languages {

    private String id;
    private String name;
    private String iso_code;
    private String language_code;
    private String active;
    private String is_rtl;
    private String date_format_lite;
    private String date_format_full;
    private int column = 8;

    public String getActive() {
        return active;
    }

    public String getDate_format_full() {
        return date_format_full;
    }

    public String getDate_format_lite() {
        return date_format_lite;
    }

    public String getId() {
        return id;
    }

    public String getIs_rtl() {
        return is_rtl;
    }

    public String getIso_code() {
        return iso_code;
    }

    public String getLanguage_code() {
        return language_code;
    }

    public String getName() {
        return name;
    }

    public void setActive(boolean active) {
        if (active = true) {
            this.active = "0";
        }
        if (active = false) {
            this.active = "1";
        }

    }

    public void setActive(String active) {
        this.active = active;
    }

    public void setDate_format_full(String date_format_full) {
        this.date_format_full = date_format_full;
    }

    public void setDate_format_lite(String date_format_lite) {
        this.date_format_lite = date_format_lite;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setIs_rtl(boolean is_rtl) {
        if (is_rtl = true) {
            this.is_rtl = "0";
        }
        if (is_rtl = false) {
            this.is_rtl = "1";
        }

    }

    public void setIs_rtl(String is_rtl) {


        this.is_rtl = is_rtl;


    }

    public void setIso_code(String iso_code) {
        this.iso_code = iso_code;
    }

    public void setLanguage_code(String language_code) {
        this.language_code = language_code;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getXMLActive() {
        return "<active>" + active + "</active>\n";
    }

    public String getXMLDate_format_full() {
        return "<date_format_full>" + date_format_full + "</date_format_full>\n";
    }

    public String getXMLDate_format_lite() {
        return "<date_format_lite>" + date_format_lite + "</date_format_lite>\n";
    }

    public String getXMLId() {
        return "<id>" + id + "</id>\n";
    }

    public String getXMLIs_rtl() {
        return "<is_rtl>" + is_rtl + "</is_rtl>\n";
    }

    public String getXMLIso_code() {
        return "<iso_code>" + iso_code + "</iso_code>\n";
    }

    public String getXMLLanguage_code() {
        return "<language_code>" + language_code + "</language_code>\n";
    }

    public String getXMLName() {
        return "<name>" + name + "</name>\n";
    }

    public String toXML() {
        String xmlLanguage = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
        xmlLanguage += "<prestashop xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n";
        xmlLanguage +="<language>\n";
        xmlLanguage += this.getXMLId();
        xmlLanguage += this.getXMLName();
        xmlLanguage += this.getXMLIso_code();
        xmlLanguage += this.getXMLLanguage_code();
        xmlLanguage += this.getXMLDate_format_lite();
        xmlLanguage += this.getXMLDate_format_full();
        xmlLanguage += this.getXMLActive();
        xmlLanguage += this.getXMLIs_rtl();
        xmlLanguage += "</language>\n";
        xmlLanguage += "</prestashop>";
        return xmlLanguage;
    }

    public int getColumn() {
        return this.column;
    }

    public String[] GetMetaData() {
        return new String[]{"id", "name", "iso_code", "language_code", "date_format_lite", "date_format_full", "active", "is_rtl"};
    }
}
